package cn.zaier.javafx;

import cn.hutool.extra.spring.SpringUtil;
import cn.zaier.javafx.controlle.InitSceneViewControlle;
import cn.zaier.javafx.view.InitSceneView;
import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import javafx.stage.Stage;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;


/**
 * javaFxRunAplication
 *
 */
@SpringBootApplication
public class JavaFxRunApplication extends AbstractJavaFxApplicationSupport{



    @Override
    public void start(Stage stage) throws Exception {
        super.start(stage);
        stage.setResizable(false);
        stage.setTitle("文件删除工具");
        stage.setAlwaysOnTop(true);
    }

    @Override
    public void stop() throws Exception {
        // 保存配置
        SpringUtil.getBean(InitSceneViewControlle.class).saveConf(InitSceneViewControlle.class,"getText");
    }

    public static void main(String[] args) {
        //改成launch方法,
        launch(JavaFxRunApplication.class, InitSceneView.class,args);

    }

}
